'use strict'
  class ActivityService {
    constructor(rpc_client) {
      this.rpc_client = rpc_client
    }
    /**
    * 查询店铺邀约活动信息(即将下线)
    * @params shopId 店铺Id
    * @return
    */
    getInvitedActivityInfos(shopId) {
      return this.rpc_client.request("eleme.activity.flash.getInvitedActivityInfos", {
        shopId: shopId,
      })
    }
    /**
    * 报名限量抢购活动(即将下线)
    * @params activityId 活动Id
    * @params activityApplyInfo 活动报名信息
    * @return
    */
    applyFlashActivity(activityId, activityApplyInfo) {
      return this.rpc_client.request("eleme.activity.flash.applyFlashActivity", {
        activityId: activityId,
        activityApplyInfo: activityApplyInfo,
      })
    }
    /**
    * 通过店铺Id和活动Id分页查询报名详情(即将下线)
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params pageNo 页码
    * @params pageSize 每页数量
    * @return
    */
    getActivityApplyInfos(activityId, shopId, pageNo, pageSize) {
      return this.rpc_client.request("eleme.activity.flash.getActivityApplyInfos", {
        activityId: activityId,
        shopId: shopId,
        pageNo: pageNo,
        pageSize: pageSize,
      })
    }
    /**
    * 修改活动菜品库存(即将下线)
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params itemId 菜品Id
    * @params stock 库存
    * @return
    */
    updateActivityItemStock(activityId, shopId, itemId, stock) {
      return this.rpc_client.request("eleme.activity.flash.updateActivityItemStock", {
        activityId: activityId,
        shopId: shopId,
        itemId: itemId,
        stock: stock,
      })
    }
    /**
    * 取消活动菜品(即将下线)
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params itemId 菜品Id
    * @return
    */
    offlineFlashActivityItem(activityId, shopId, itemId) {
      return this.rpc_client.request("eleme.activity.flash.offlineFlashActivityItem", {
        activityId: activityId,
        shopId: shopId,
        itemId: itemId,
      })
    }
    /**
    * 作废店铺与活动的关联关系(即将下线)
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @return
    */
    invalidShopActivity(activityId, shopId) {
      return this.rpc_client.request("eleme.activity.flash.invalidShopActivity", {
        activityId: activityId,
        shopId: shopId,
      })
    }
    /**
    * 创建减配送费活动
    * @params createInfo 创建减配送费活动的结构体
    * @params shopId 店铺Id
    * @return
    */
    createShippingFeeActivity(createInfo, shopId) {
      return this.rpc_client.request("eleme.activity.shippingFee.createShippingFeeActivity", {
        createInfo: createInfo,
        shopId: shopId,
      })
    }
    /**
    * 作废减配送费活动
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params comment 作废原因
    * @return
    */
    invalidShippingFeeActivity(activityId, shopId, comment) {
      return this.rpc_client.request("eleme.activity.shippingFee.invalidShippingFeeActivity", {
        activityId: activityId,
        shopId: shopId,
        comment: comment,
      })
    }
    /**
    * 通过店铺Id查询该店铺被邀约的美食活动
    * @params shopId 店铺Id
    * @return
    */
    queryInvitedFoodActivities(shopId) {
      return this.rpc_client.request("eleme.activity.food.queryInvitedFoodActivities", {
        shopId: shopId,
      })
    }
    /**
    * 报名美食活动
    * @params activityId 活动Id
    * @params activityApplyInfo 活动报名信息
    * @return
    */
    applyFoodActivity(activityId, activityApplyInfo) {
      return this.rpc_client.request("eleme.activity.food.applyFoodActivity", {
        activityId: activityId,
        activityApplyInfo: activityApplyInfo,
      })
    }
    /**
    * 通过店铺Id和活动Id分页查询店铺已报名的美食活动
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params pageNo 页码
    * @params pageSize 每页数量
    * @return
    */
    queryFoodActivities(activityId, shopId, pageNo, pageSize) {
      return this.rpc_client.request("eleme.activity.food.queryFoodActivities", {
        activityId: activityId,
        shopId: shopId,
        pageNo: pageNo,
        pageSize: pageSize,
      })
    }
    /**
    * 修改美食活动的菜品库存
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params itemId 菜品Id
    * @params stock 库存
    * @return
    */
    updateFoodActivityItemStock(activityId, shopId, itemId, stock) {
      return this.rpc_client.request("eleme.activity.food.updateFoodActivityItemStock", {
        activityId: activityId,
        shopId: shopId,
        itemId: itemId,
        stock: stock,
      })
    }
    /**
    * 取消参与了美食活动的菜品
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params itemId 菜品Id
    * @return
    */
    offlineFoodActivityItem(activityId, shopId, itemId) {
      return this.rpc_client.request("eleme.activity.food.offlineFoodActivityItem", {
        activityId: activityId,
        shopId: shopId,
        itemId: itemId,
      })
    }
    /**
    * 作废店铺与美食活动的关联关系
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @return
    */
    unbindFoodActivity(activityId, shopId) {
      return this.rpc_client.request("eleme.activity.food.unbindFoodActivity", {
        activityId: activityId,
        shopId: shopId,
      })
    }
    /**
    * 创建红包活动(即将下线)
    * @params createInfo 创建红包活动的结构体
    * @return
    */
    createCouponActivity(createInfo) {
      return this.rpc_client.request("eleme.activity.coupon.createCouponActivity", {
        createInfo: createInfo,
      })
    }
    /**
    * 向指定用户发放红包(即将下线)
    * @params shopId 店铺Id
    * @params couponActivityId 红包活动Id
    * @params mobiles 需要发放红包的用户手机号列表
    * @return
    */
    giveOutCoupons(shopId, couponActivityId, mobiles) {
      return this.rpc_client.request("eleme.activity.coupon.giveOutCoupons", {
        shopId: shopId,
        couponActivityId: couponActivityId,
        mobiles: mobiles,
      })
    }
    /**
    * 定向赠红包
    * @params shopId 店铺Id
    * @params mobile 需要发放红包的用户手机号
    * @params couponTemplate 定向赠红包的模板信息
    * @return
    */
    presentCoupon(shopId, mobile, couponTemplate) {
      return this.rpc_client.request("eleme.activity.coupon.presentCoupon", {
        shopId: shopId,
        mobile: mobile,
        couponTemplate: couponTemplate,
      })
    }
    /**
    * 分页查询店铺红包活动信息(即将下线)
    * @params shopId 店铺Id
    * @params couponActivityType 红包活动类型
    * @params activityStatus 活动状态
    * @params pageNo 页码（第几页）
    * @params pageSize 每页数量
    * @return
    */
    queryCouponActivities(shopId, couponActivityType, activityStatus, pageNo, pageSize) {
      return this.rpc_client.request("eleme.activity.coupon.queryCouponActivities", {
        shopId: shopId,
        couponActivityType: couponActivityType,
        activityStatus: activityStatus,
        pageNo: pageNo,
        pageSize: pageSize,
      })
    }
    /**
    * 分页查询店铺红包领取详情(即将下线)
    * @params shopId 店铺Id
    * @params couponActivityId 红包活动Id
    * @params couponStatus 红包状态
    * @params pageNo 页码（第几页）
    * @params pageSize 每页数量
    * @return
    */
    queryReceivedCouponDetails(shopId, couponActivityId, couponStatus, pageNo, pageSize) {
      return this.rpc_client.request("eleme.activity.coupon.queryReceivedCouponDetails", {
        shopId: shopId,
        couponActivityId: couponActivityId,
        couponStatus: couponStatus,
        pageNo: pageNo,
        pageSize: pageSize,
      })
    }
    /**
    * 托管单店红包服务
    * @params shopIds 餐厅id列表,长度不能超过20
    * @params hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
    * @params discounts 扣减额,请设置在[4,15]元,小数点后最多1位
    * @return
    */
    hostShops(shopIds, hostedType, discounts) {
      return this.rpc_client.request("eleme.activity.coupon.hostShops", {
        shopIds: shopIds,
        hostedType: hostedType,
        discounts: discounts,
      })
    }
    /**
    * 查询红包服务托管情况
    * @params shopIds 餐厅id列表,长度不能超过20
    * @params hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
    * @return
    */
    queryHostInfo(shopIds, hostedType) {
      return this.rpc_client.request("eleme.activity.coupon.queryHostInfo", {
        shopIds: shopIds,
        hostedType: hostedType,
      })
    }
    /**
    * 取消托管单店红包服务
    * @params shopIds 餐厅id列表,长度不能超过20
    * @params hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
    * @return
    */
    unhostShops(shopIds, hostedType) {
      return this.rpc_client.request("eleme.activity.coupon.unhostShops", {
        shopIds: shopIds,
        hostedType: hostedType,
      })
    }
    /**
    * 更改单店红包服务托管方式
    * @params shopId 店铺Id
    * @params hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
    * @params oActivityServiceDetails 服务内容
    * @return
    */
    rehostShop(shopId, hostedType, oActivityServiceDetails) {
      return this.rpc_client.request("eleme.activity.coupon.rehostShop", {
        shopId: shopId,
        hostedType: hostedType,
        oActivityServiceDetails: oActivityServiceDetails,
      })
    }
    /**
    * 定向赠红包(单店红包)
    * @params shopId 店铺id
    * @params targetList 目标列表
    * @params targetListType 目标类型
    * @params targetCouponDetail 定向赠红包模板细节
    * @return
    */
    presentTargetCoupons(shopId, targetList, targetListType, targetCouponDetail) {
      return this.rpc_client.request("eleme.activity.coupon.presentTargetCoupons", {
        shopId: shopId,
        targetList: targetList,
        targetListType: targetListType,
        targetCouponDetail: targetCouponDetail,
      })
    }
    /**
    * 定向赠通用红包
    * @params chainId 连锁店id
    * @params targetList 目标列表
    * @params targetListType 目标类型
    * @params commonTargetCouponDetail 通用定向赠红包模板细节
    * @return
    */
    presentCommonTargetCoupons(chainId, targetList, targetListType, commonTargetCouponDetail) {
      return this.rpc_client.request("eleme.activity.coupon.presentCommonTargetCoupons", {
        chainId: chainId,
        targetList: targetList,
        targetListType: targetListType,
        commonTargetCouponDetail: commonTargetCouponDetail,
      })
    }
    /**
    * 分页查询店铺的定向赠红包信息
    * @params targetCouponQueryRequest 定向赠红包查询入参对象
    * @return
    */
    queryTargetCouponInfo(targetCouponQueryRequest) {
      return this.rpc_client.request("eleme.activity.coupon.queryTargetCouponInfo", {
        targetCouponQueryRequest: targetCouponQueryRequest,
      })
    }
    /**
    * 定向赠通用商品券
    * @params chainId 连锁店id
    * @params targetList 目标列表
    * @params targetListType 目标类型
    * @params commonTargetSkuCouponDetail 通用定向赠连锁商品券模板细节
    * @return
    */
    presentCommonTargetSkuCoupons(chainId, targetList, targetListType, commonTargetSkuCouponDetail) {
      return this.rpc_client.request("eleme.activity.coupon.presentCommonTargetSkuCoupons", {
        chainId: chainId,
        targetList: targetList,
        targetListType: targetListType,
        commonTargetSkuCouponDetail: commonTargetSkuCouponDetail,
      })
    }
    /**
    * 定向赠连锁通用商品券
    * @params chainId 连锁店id
    * @params targetList 目标列表
    * @params targetListType 目标类型
    * @params chainSkuCouponDetail 通用定向赠连锁商品券模板细节
    * @return
    */
    presentChainSkuCoupons(chainId, targetList, targetListType, chainSkuCouponDetail) {
      return this.rpc_client.request("eleme.activity.coupon.presentChainSkuCoupons", {
        chainId: chainId,
        targetList: targetList,
        targetListType: targetListType,
        chainSkuCouponDetail: chainSkuCouponDetail,
      })
    }
    /**
    * 定向赠指定商品券
    * @params targetList 目标列表
    * @params targetListType 目标类型
    * @params skuCouponDetail 商品券模板细节
    * @return
    */
    presentSkuCoupons(targetList, targetListType, skuCouponDetail) {
      return this.rpc_client.request("eleme.activity.coupon.presentSkuCoupons", {
        targetList: targetList,
        targetListType: targetListType,
        skuCouponDetail: skuCouponDetail,
      })
    }
    /**
    * 券状态变更
    * @params criteria 券状态修改对象
    * @params type 操作类型
    * @return
    */
    updateCouponStatus(criteria, type) {
      return this.rpc_client.request("eleme.activity.coupon.updateCouponStatus", {
        criteria: criteria,
        type: type,
      })
    }
    /**
    * 创建并绑定连锁店特价活动
    * @params activity 活动创建信息
    * @params chainId 连锁店Id
    * @params shopApplyInfo  绑定的商品信息
    * @return
    */
    createAndParticipateChainPriceActivity(activity, chainId, shopApplyInfo) {
      return this.rpc_client.request("eleme.activity.skuchain.createAndParticipateChainPriceActivity", {
        activity: activity,
        chainId: chainId,
        shopApplyInfo: shopApplyInfo,
      })
    }
    /**
    * 根据活动Id和店铺Id和商品规格Id，作废参与关系
    * @params activityId 活动Id
    * @params shopId 店铺Id
    * @params specId 商品规格Id
    * @params comment 作废原因
    * @return
    */
    inValidSkuActivityById(activityId, shopId, specId, comment) {
      return this.rpc_client.request("eleme.activity.skuchain.inValidSkuActivityById", {
        activityId: activityId,
        shopId: shopId,
        specId: specId,
        comment: comment,
      })
    }
}

module.exports = ActivityService